#ifndef _MRANDOM_HPP_
#define _MRANDOM_HPP_

#include <random>
#include <functional>

class Rand_int
{
private:
  std::function<int()> r;

public:
  Rand_int(int lo, int hi)
      : r(std::bind(std::uniform_int_distribution<>(lo, hi), std::default_random_engine{})) {}
  int operator()() { return r(); }
};

class Rand_double
{
private:
  std::function<double()> r;

public:
  Rand_double(double lo, double hi)
      : r(std::bind(std::uniform_real_distribution<>(lo, hi), std::default_random_engine{})) {}
  double operator()() { return r(); }
};
using RandInt = Rand_int;
using RandDouble = Rand_double;
#endif